<?php 
defined('IN_TS') or die('Access Denied.');

include 'userinfo.php';

$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('user','gift',array('id'=>$strUser['userid'],'page'=>''));
$lstart = $page*15-15;

$arrGifts = $new['user']->findAll('gift',array(
	'userid'=>$strUser['userid'],
),'addtime desc',null,$lstart.',15');

foreach ( $arrGifts as $key => $item ) {
	$arrGift [] = $item;
	$arrGift [$key]['title'] = tsTitle($item['title']);
	$arrGift [$key] ['user'] = aac ( 'user' )->getOneUser ( $item ['userid'] );
}

$giftNum = $new['user']->findCount('gift',array(
	'userid'=>$strUser['userid']
));
$pageUrl = pagination($giftNum, 15, $page, $url);

$title = $strUser['username'].'的义卖';
include template('gift');